package com.xfd.learn.enums;

/**
 * @since 2024-10-23
 * @author xfd
 */
public enum LoggerLevel {

    NONE(0),

    BASIC(1),

    HEADERS(2),

    BODY(3),
    ;

    private final int level;

    LoggerLevel(int level) {
        this.level = level;
    }

    public int getLevel() {
        return level;
    }

    /**
     * 日志等级比较
     * 当前版本 小于和等于 比较的版本
     * @param loggerLevel loggerLevel
     * @return 是否小于和等于
     */
    public boolean lte(LoggerLevel loggerLevel) {
        return this.level <= loggerLevel.level;
    }
}
